#!/usr/bin/ruby
require 'parser'
require 'rubygems'
require 'mechanize'
require 'logger'

search_string="email contact group"
max_level=40
 
 agent = Mechanize.new
 agent.user_agent_alias = 'Mac Safari'
 page = agent.get("http://www.google.com/")
 search_form = page.form_with(:name => "f")
 search_form.field_with(:name => "q").value = search_string
 search_results = agent.submit(search_form)
 Parser.new(search_results.links.uniq, 0, max_level)
 
